package com.wtwd.device.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wtwd.device.model.entity.DialManagement;
import com.wtwd.device.model.entity.GetGroupIdAndDialByGroupIds;
import com.wtwd.device.model.entity.GroupInfo;
import com.wtwd.device.model.vo.GetGroupDialVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author zdl
 * @since 2023-01-03
 */
@Mapper
public interface GroupInfoMapper extends BaseMapper<GroupInfo> {

    int updateGroupSequence(@Param("groupId") Integer groupId, @Param("sequence") Integer sequence);

    IPage<GetGroupDialVo> getGroupDialPage(@Param("groupId") Integer groupId, @Param("dialName") String dialName,
                                           @Param("watchId") String watchId, @Param("page") Page<GroupInfo> page);

    List<GroupInfo> getGroupInfoByWatchId(@Param("watchId") String watchId);

    List<DialManagement> getDialByWatchIdAndGroupId(@Param("groupId") Integer groupId, @Param("watchId") String watchId
            , @Param("start") int start, @Param("pageSize") int pageSize);

    List<GetGroupIdAndDialByGroupIds> getGroupIdAndDialByGroupIds(@Param("list") List<Integer> groupIds, @Param("watchId") String watchId);

    List<GroupInfo> getGroupInfoByDialId(@Param("dialId") Integer dialId);
}
